package com.best.oasis.settlement.service.security;

import java.util.List;

import com.best.oasis.settlement.common.entity.security.RoleGroup;
import com.best.oasis.settlement.common.so.security.RoleGroupSO;
import com.best.oasis.settlement.common.vo.security.RoleGroupVO;
import com.best.oasis.settlement.common.vo.security.RoleVO;
import com.best.oasis.settlement.common.vo.security.UserVO;
import com.best.oasis.settlement.service.base.BaseService;
import com.best.oasis.settlement.util.page.PageList;

public interface RoleGroupService extends BaseService<RoleGroup, RoleGroupVO, Long>{
    /**
     * 根据so进行搜索T的对象，返回可以翻页的对象列表
     * @param so
     * @return
     */
    public abstract PageList<RoleGroupVO> getRoleGroupPageList(RoleGroupSO so);
	/**
	 * 根据一组roleGroupId,获取所有Role
	 */
	public List<RoleGroupVO> getAll(List<Long> roleGroupIds);

	/**
	 * 根据一组roleGroupId,获取所有RoleGroup
	 */
	public List<RoleVO> getAllRoles(List<Long> roleGroupIds);
	
	/**
	 * 授予某个用户一组RoleGroup权限
	 * @param user 被授权的用户
	 * @param roleGroupIds
	 */
	public void authorize(UserVO user,List<Long> roleGroupIds);
	
	/**
	 * 修改某一个roleGroup
	 * @param roleGroup	 
	 */
	public RoleGroupVO update(RoleGroupVO roleGroup);
	/**
	 * 根据roleName获得roleVO
	 * @param roleName
	 */
	public RoleGroupVO getByRoleName(String roleName);
	
	public List<RoleGroupVO> getAllByName(RoleGroupSO so);
	public List<RoleGroupVO> getRoleGroupsByUserid(Long userID);
	/**
	 * 获得所有的RoleGroup对象，且该对象所关联的roles和users不会被级联取出
	 * @return
	 */
	public List<RoleGroupVO> getAllWithoutCascade();
}
